package com.cne.gmail.Gmail.intercepotor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Date: 2017/12/22 14:29
 * @Modified:
 * @Description:
 */
public class UserLoginInterceptor extends HandlerInterceptorAdapter {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserLoginInterceptor.class);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
        // 不拦截 options请求
      /*  String method = request.getMethod();
        if(HttpMethod.OPTIONS.matches(method)){
            return true;
        }
        if(!SessionHelper.isEffectiveSession(request)) {
            LOGGER.info("当前请求 currentUri = {}, 登录信息已过期，重新登录",request.getRequestURI());
            throw new UnauthorizedException();
        }*/
        return true;

    }


}
